﻿<sap:ActivityDesigner x:Class="Active.Activities.ActivityDesigners.SetFolderPermissionsDesigner"
   	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		xmlns:local="clr-namespace:Active.Activities.ActivityDesigners.Converters"
		xmlns:sap="clr-namespace:System.Activities.Presentation;assembly=System.Activities.Presentation"
		xmlns:sapc="clr-namespace:System.Activities.Presentation.Converters;assembly=System.Activities.Presentation"
		xmlns:sapv="clr-namespace:System.Activities.Presentation.View;assembly=System.Activities.Presentation" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" Width="Auto" Height="Auto" Loaded="ActivityDesigner_Loaded">
	<sap:ActivityDesigner.Icon>
		<DrawingBrush>
			<DrawingBrush.Drawing>
				<ImageDrawing>
					<ImageDrawing.Rect>
						<Rect Location="0,0" Size="16,16" ></Rect>
					</ImageDrawing.Rect>
					<ImageDrawing.ImageSource>
						<BitmapImage UriSource="/Active.Activities;component/Resources/SetFolderPermissions.png"></BitmapImage>
					</ImageDrawing.ImageSource>
				</ImageDrawing>
			</DrawingBrush.Drawing>
		</DrawingBrush>
	</sap:ActivityDesigner.Icon>
	<sap:ActivityDesigner.Resources>
		<ResourceDictionary>
			<sapc:ArgumentToExpressionConverter x:Key="ArgumentToExpressionConverter" />
			<local:InArgumentBoolConverter x:Key="InArgumentBoolConverter" />
		</ResourceDictionary>
	</sap:ActivityDesigner.Resources>
	<Grid>
		<Grid.RowDefinitions>
			<RowDefinition Height="*" />
			<RowDefinition Height="*" />
			<RowDefinition Height="*" />
			<RowDefinition Height="*" />
			<RowDefinition Height="*" />
		</Grid.RowDefinitions>
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="500" />
			<ColumnDefinition Width="35" />
		</Grid.ColumnDefinitions>
		<sapv:ExpressionTextBox 
			HintText="Full path of folder to set permissions for" 
			Expression="{Binding Path=ModelItem.FolderPath, Mode=TwoWay, Converter={StaticResource ResourceKey=ArgumentToExpressionConverter}}" 
			OwnerActivity="{Binding Path=ModelItem}" 
			Margin="110,5,5,5" 
			VerticalAlignment="Stretch"
			HorizontalAlignment="Stretch"></sapv:ExpressionTextBox>
		<sapv:ExpressionTextBox 
			HintText="Username or Group to set permissions for" 
			Expression="{Binding Path=ModelItem.UserOrGroup, Mode=TwoWay, Converter={StaticResource ResourceKey=ArgumentToExpressionConverter}}" 
			OwnerActivity="{Binding Path=ModelItem}" 
			Margin="110,5,5,5" Grid.Row="1"
			VerticalAlignment="Stretch"
			HorizontalAlignment="Stretch"></sapv:ExpressionTextBox>		
		<Label Content="Folder Path :" Height="28" HorizontalAlignment="Left" Margin="5,3,0,0" VerticalAlignment="Top" />
		<Label Content="Identity :" Height="28" HorizontalAlignment="Left" Margin="5,3,0,0" VerticalAlignment="Top" Grid.Row="1" />
		<CheckBox Content="Show Output" Height="16" HorizontalAlignment="Left" Margin="12,6,0,0" Name="chkShowOutput" VerticalAlignment="Top" Grid.Row="4" IsThreeState="False" IsChecked="{Binding Path=ModelItem.ShowOutput, Mode=TwoWay, Converter={StaticResource InArgumentBoolConverter}}" />
		<Button Content="..." Height="23" HorizontalAlignment="Left" Margin="7,4,0,0" Name="btnPickFileSystemPath" VerticalAlignment="Top" Width="28" Grid.Column="1" Click="btnPickFileSystemPath_Click" />
		<Button Content="..." Height="23" HorizontalAlignment="Left" Margin="7,4,0,0" Name="btnPickIdentityName" VerticalAlignment="Top" Width="28" Grid.Column="1" Grid.Row="1" Click="btnPickIdentityName_Click" />

		<CheckBox Content="Read" Height="16" HorizontalAlignment="Left" Margin="12,6,0,0" Name="chkRead" VerticalAlignment="Top" Grid.Row="3" IsThreeState="False" IsChecked="{Binding Path=ModelItem.Read, Mode=TwoWay, Converter={StaticResource InArgumentBoolConverter}}" />
		<CheckBox Content="Write" Height="16" HorizontalAlignment="Left" Margin="110,6,0,0" Name="chkWrite" VerticalAlignment="Top" Grid.Row="3" IsThreeState="False" IsChecked="{Binding Path=ModelItem.Write, Mode=TwoWay, Converter={StaticResource InArgumentBoolConverter}}" />
		<CheckBox Content="Read &amp; Execute" Height="16" HorizontalAlignment="Left" Margin="221,6,0,0" Name="chkExecute" VerticalAlignment="Top" Grid.Row="3" IsThreeState="False" IsChecked="{Binding Path=ModelItem.ReadAndExecute, Mode=TwoWay, Converter={StaticResource InArgumentBoolConverter}}" />
	</Grid>
</sap:ActivityDesigner>